package com.test.demo;

/**
 * ${DESCRIPTION}
 *
 * @author muxiaoyu
 * @create 2017/05/11 15:44
 **/
public class StringDemo {
    public static void main(String[] args) {
        String s1 = "abc@123";
        String s2 = "abc@123";
        System.out.println(s1 == s2);
        System.out.println(s1.equals(s2));
        String s3 = new String("abc@123");
        System.out.println(s1.hashCode());
        System.out.println(s3.hashCode());

        System.out.println(System.identityHashCode(s1));
        System.out.println(System.identityHashCode(s2));
        System.out.println(System.identityHashCode(s3));
        System.out.println(s1 == s3);
        System.out.println("abc777".hashCode());
    }
}
